import request from './request/index.js'

// 增 (Create) - C
// 查 (Read)   - R
// 改 (Update) - U
// 删 (Delete) - D

// copyright 缩写：符号形式 © 文本形式 Copr.

const apiCoprCopyC = (d) => request({ method: 'post', url: '/copyright/copy/create', data: d})
const apiCoprCopyR = (d) => request({ method: 'get', url: '/copyright/copy/get', data: d})
const apiCoprCopyU = (d) => request({ method: 'put', url: '/copyright/copy/update', data: d})
const apiCoprCopyD = (d) => request({ method: 'delete', url: '/copyright/copy/delete', data: d})
const apiCoprCopyP = (d) => request({ method: 'get', url: '/copyright/copy/page', data: d})
const apiCoprCopyUP = (d) => request({ method: 'get', url: '/copyright/copy/userPage', data: d })
const apiCoprCopyDegree = (d) => request({ method: 'post', url: '/copyright/copy/degree', data: d}) // 作品版权免费申请次数
export const ApiCoprCopy = {
  C: apiCoprCopyC,
  R: apiCoprCopyR,
  U: apiCoprCopyU,
  D: apiCoprCopyD,
  P: apiCoprCopyP,
  UP: apiCoprCopyUP,
  CDegree:apiCoprCopyDegree
}

const apiCoprPayC = (d) => request({ method: 'post', url: '/copyright/pay/create', data: d})
const apiCoprPayR = (d) => request({ method: 'get', url: '/copyright/pay/get', data: d})
const apiCoprPayU = (d) => request({ method: 'put', url: '/copyright/pay/update', data: d})
const apiCoprPayD = (d) => request({ method: 'delete', url: '/copyright/pay/delete', data: d})
const apiCoprPayCnl = (d) => request({ method: 'put', url: '/copyright/pay/cancel', data: d }) // 取消 -
const apiCoprPayPg = (d) => request({ method: 'get', url: '/copyright/pay/page', data: d })
const apiCoprPayRPay = (d) => request({ method: 'get', url: '/copyright/pay/getCopyrightPay', data: d })
const apiCoprPayUsrPg = (d) => request({ method: 'get', url: '/copyright/pay/userPage', data: d }) // 持有作品
const apiCoprPayGP = (d) => request({ method: 'get', url: '/copyright/pay/getProductId', data: d }) //获得版权作品持有者
const apiCoprPayW = (d) => request({ method: 'get', url: '/copyright/pay/want', data: d })  //判断是否开启求购
const apiCoprPayPre = (d) => request({ method: 'post', url: '/copyright/pay/precondition', data: d }) //判断前置条件
export const ApiCoprPay = {
  C: apiCoprPayC,
  R: apiCoprPayR,
  U: apiCoprPayU,
  D: apiCoprPayD,
  Cnl: apiCoprPayCnl,
  Pg: apiCoprPayPg,
  RPay: apiCoprPayRPay,
  UsrPg: apiCoprPayUsrPg,
  PayGP: apiCoprPayGP,
  PayW: apiCoprPayW,
  PayPre:apiCoprPayPre
}

const apiCoprWantC = (d) => request({ method: 'post', url: '/copyright/want/create', data: d }) // 创建 - 求购份额申请
const apiCoprWantR = (d) => request({ method: 'get', url: '/copyright/want/get', data: d }) // 获取 -
const apiCoprWantU = (d) => request({ method: 'put', url: '/copyright/want/update', data: d }) // 更新 -
const apiCoprWantD = (d) => request({ method: 'delete', url: '/copyright/want/delete', data: d }) // 删除 -
const apiCoprWantCnl = (d) => request({ method: 'put', url: '/copyright/want/cancel', data: d }) // 取消 -
const apiCoprWantPg = (d) => request({ method: 'get', url: '/copyright/want/page', data: d }) // 分页 - 求购列表
const apiCoprWantOrdPg = (d) => request({ method: 'get', url: '/copyright/want/orderPage', data: d }) // 分页 - 求购出售列表
// const apiCoprWantSel = (d) => request({ method: 'put', url: '/copyright/want/select', data: d }) // 选中 -
// const apiCoprWantOrdSell = (d) => request({ method: 'post', url: '/copyright/want/orderForSale', data: d }) // 出售 -
export const ApiCoprWant = {
  C: apiCoprWantC,
  R: apiCoprWantR,
  U: apiCoprWantU,
  D: apiCoprWantD,
  Cnl: apiCoprWantCnl,
  Pg: apiCoprWantPg,
  OrdPg: apiCoprWantOrdPg,
  // Sel: apiCoprWantSel,
  // OrdSell: apiCoprWantOrdSell,
}

const apiCoprWpayR = (d) => request({ method: 'get', url: '/copyright/wantPay/get', data: d }) // 获取 - 求购出售
const apiCoprWpayU = (d) => request({ method: 'put', url: '/copyright/wantPay/update', data: d }) // 更新 -
const apiCoprWpayPg = (d) => request({ method: 'get', url: '/copyright/wantPay/page', data: d }) // 分页 - 
const apiCoprWpayOrdPg = (d) => request({ method: 'get', url: '/copyright/wantPay/orderPayPage', data: d }) // 分页 - 
const apiCoprWpayOrdSell = (d) => request({ method: 'post', url: '/copyright/wantPay/orderForSale', data: d }) // 出售 -
export const ApiCoprWpay = {
  R: apiCoprWpayR,
  U: apiCoprWpayU,
  Pg: apiCoprWpayPg,
  OrdPg: apiCoprWpayOrdPg,
  OrdSell: apiCoprWpayOrdSell
}

const apiCoprWpayLogR = (d) => request({ method: 'get', url: '/copyright/wantPayLog/get', data: d }) // 获取 - 求购出售记录
const apiCoprWpayLogPg = (d) => request({ method: 'get', url: '/copyright/wantPayLog/page', data: d }) // 分页 - 
const apiCoprWpayLogOrdPg = (d) => request({ method: 'get', url: '/copyright/wantPayLog/orderPayPage', data: d }) // 分页 - 
export const ApiCoprWpayLog = {
  R: apiCoprWpayLogR,
  Pg: apiCoprWpayLogPg,
  OrdPg: apiCoprWpayLogOrdPg,
}